(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/work/house/edit", "pages/work/components/multi-select" ], {
    "0168": function(t, e, i) {
        i.r(e);
        var o, n = i("9834"), s = i.n(n);
        for (o in n) "default" !== o && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(o);
        e.default = s.a;
    },
    "017d": function(t, e, i) {
        i.d(e, "b", function() {
            return o;
        }), i.d(e, "c", function() {
            return n;
        }), i.d(e, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, n = [];
    },
    "040c": function(t, e, i) {
        i.r(e);
        var o, n = i("55ff"), s = i.n(n);
        for (o in n) "default" !== o && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(o);
        e.default = s.a;
    },
    4568: function(t, e, i) {
        i.r(e);
        var o, n = i("a7d7"), s = i("0168");
        for (o in s) "default" !== o && function(t) {
            i.d(e, t, function() {
                return s[t];
            });
        }(o);
        i("5a37");
        var a = i("f0c5"), n = Object(a.a)(s.default, n.b, n.c, !1, null, null, null, !1, n.a, void 0);
        e.default = n.exports;
    },
    "55ff": function(t, e, i) {
        Object.defineProperty(e, "__esModule", {
            value: !0
        }), e.default = void 0;
        var o = {
            name: "multiSelect",
            props: {
                listArr: {
                    type: Array,
                    default: []
                },
                defaultArr: {
                    type: String,
                    default: ""
                },
                type: {
                    type: String,
                    default: "single"
                },
                mess: {
                    type: String,
                    default: ""
                }
            },
            data: function() {
                return {
                    isShow: !1,
                    listArrNew: []
                };
            },
            watch: {
                listArr: {
                    handler: function(t, e) {
                        console.info("change"), this.listArrNew = JSON.parse(JSON.stringify(t));
                    },
                    deep: !0
                }
            },
            computed: {},
            methods: {
                showPicker: function() {
                    var t = this;
                    setTimeout(function() {
                        t.isShow = !0;
                    }, 100);
                },
                closePicker: function() {
                    this.isShow = !1, console.info(this.listArr), this.listArrNew = JSON.parse(JSON.stringify(this.listArr));
                },
                itemClick: function(t) {
                    this.listArrNew[t].select = !this.listArrNew[t].select;
                },
                okClick: function() {
                    var o = [], n = [];
                    this.listArrNew.forEach(function(t, e, i) {
                        t.select && (o.push(t.id), n.push(t.name));
                    });
                    var t = {
                        ids: o.join(","),
                        names: n.join(","),
                        list: this.listArrNew
                    };
                    console.info(t), this.$emit("confirm", t), this.isShow = !1;
                }
            }
        };
        e.default = o;
    },
    "5a37": function(t, e, i) {
        var o = i("6910");
        i.n(o).a;
    },
    "68c0": function(t, e, i) {
        var o = i("c7e1");
        i.n(o).a;
    },
    6910: function(t, e, i) {},
    9834: function(t, o, s) {
        (function(n) {
            Object.defineProperty(o, "__esModule", {
                value: !0
            }), o.default = void 0;
            var t, e = s("26cb");
            function i(e, t) {
                var i, o = Object.keys(e);
                return Object.getOwnPropertySymbols && (i = Object.getOwnPropertySymbols(e), t && (i = i.filter(function(t) {
                    return Object.getOwnPropertyDescriptor(e, t).enumerable;
                })), o.push.apply(o, i)), o;
            }
            (t = s("b309")) && t.__esModule;
            e = {
                components: {
                    houseStw: function() {
                      console.log('come');
                        s.e("pages/work/components/house-stw").then(function() {
                            return resolve(s("a643"));
                        }.bind(null, s)).catch(s.oe);
                    },
                    houseAttribute: function() {
                        console.log('yesff');
                        s.e("pages/work/components/house-attribute").then(function() {
                            return resolve(s("0a5d"));
                        }.bind(null, s)).catch(s.oe);
                    }
                },
                data: function() {
                    return {
                        isLoading: 1,
                        step: 2,
                        house: {
                            id: 0,
                            let_way: 1,
                            name: "",
                            tel: "",
                            dong: "",
                            tit: "",
                            dy: "",
                            doorplate: "",
                            mian_ji: "",
                            room_type: "",
                            rent: "",
                            ya_month: "",
                            fu_month: "",
                            video: "",
                            cover: [],
                            kt_imgs: [],
                            fj_imgs: [],
                            cf_imgs: [],
                            wsj_imgs: [],
                            hx_imgs: [],
                            xq_imgs: [],
                            guarantee: "",
                            content: "",
                            name2: "",
                            // tel2: "",
                            remark: "",
                            tag_ids: "",
                            tag_names: "",
                            furnish_ids: "",
                            furnish_names: "",
                            stw_index: [ 0, 1, 1 ],
                            stw_names: "",
                            attribute_index: [ 0, 0, 0 ],
                            attribute_names: "",
                            wt_type_index: 0
                        },
                        tagList: [],
                        furnishList: [],
                        wt_type_list: [],
                        step_list: [ {
                            num: 1,
                            txt: "1",
                            txt2: "第一步"
                        }, {
                            num: 2,
                            txt: "2",
                            txt2: "第二步"
                        }, {
                            num: 3,
                            txt: "3",
                            txt2: "第三步"
                        } ],
                        let_way_list: [ {
                            name: "整租",
                            value: 1
                        }, {
                            name: "合租",
                            value: 2
                        } ]
                    };
                },
                computed: function(o) {
                    for (var t = 1; t < arguments.length; t++) {
                        var n = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? i(Object(n), !0).forEach(function(t) {
                            var e, i;
                            e = o, t = n[i = t], i in e ? Object.defineProperty(e, i, {
                                value: t,
                                enumerable: !0,
                                configurable: !0,
                                writable: !0
                            }) : e[i] = t;
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(n)) : i(Object(n)).forEach(function(t) {
                            Object.defineProperty(o, t, Object.getOwnPropertyDescriptor(n, t));
                        });
                    }
                    return o;
                }({}, (0, e.mapState)({
                    isLogin: function(t) {
                        return t.user.isLogin;
                    },
                    basicSet: function(t) {
                        return t.init.basicSet;
                    },
                    pubCommunity: function(t) {
                        return t.pub.pubCommunity;
                    }
                })),
                onLoad: function() {
                    var t = this.$Route.query;
                    t.id && (this.house.id = t.id), this.init();
                    if(t.id){
                      wx.setNavigationBarTitle({
                        title: '修改房源',
                      })
                    }
                },
                onReady: function() {},
                onShareAppMessage: function() {
                    return {
                        path: "pages/work/house/edit",
                        success: function(t) {},
                        title: this.info.title,
                        imageUrl: this.info.photo_url
                    };
                },
                methods: {
                    init: function() {
                        var i = this;
                        i.$api("lethouse.pubInit", {
                            id: i.house.id
                        }).then(function(t) {
                            var e;
                            0 === t.errno ? 0 == t.data.code && (i.tagList = t.data.tagList, i.furnishList = t.data.furnishList, 
                            i.wt_type_list = t.data.wt_type_list, i.$store.commit("shiList", t.data.shiList), 
                            // i.$store.commit("cityList", t.data.shiList), 
                            // i.$store.commit("tingList", t.data.tingList), i.$store.commit("weiList", t.data.weiList), 
                            i.$store.commit("typeList", t.data.typeList), i.$store.commit("decorateList", t.data.decorateList), 
                            i.$store.commit("directionList", t.data.directionList), 0 < i.house.id) && (i.house = t.data.house, 
                            (e = t.data.community) && (e = {
                                id: e.id,
                                name: e.name
                            }, i.$store.commit("pubCommunity", e))) : i.$tools.toast(t.msg);
                        });
                    },
                    select_way: function(t) {
                        this.house.let_way = t;
                    },
                    last: function() {
                        1 < this.step && this.step--;
                    },
                    next: function() {
                        if (2 == this.step) {
                            if (!this.pubCommunity.name) return void this.$tools.toast("请选择小区");
                            if (!this.house.doorplate) return void this.$tools.toast("请填写门牌号");
                            if (!this.house.shi) return void this.$tools.toast("请选择房型");
                            if (!this.house.type) return void this.$tools.toast("请选择属性");
                        }
                        this.step++;
                    },
                    openTag: function() {
                        this.$refs.multiSelect.showPicker();
                    },
                    openFurnish: function() {
                        this.$refs.multiSelect2.showPicker();
                    },
                    tagConfirm: function(t) {
                        console.info(t), this.house.tag_ids = t.ids, this.house.tag_names = t.names;
                    },
                    furnishConfirm: function(t) {
                        this.house.furnish_ids = t.ids, this.house.furnish_names = t.names;
                    },
                    wtTypeChange: function(t) {
                        this.house.wt_type_index = t.detail.value;
                    },
                    onChooseImg: function(e, t) {
                        var i = this, t = t - e.length;
                        i.$tools.chooseImage(t).then(function(t) {
                            t.forEach(function(t) {
                                i.$tools.uploadFile("file.upload", t).then(function(t) {
                                    e.push(t.url);
                                });
                            });
                        });
                    },
                    delImg: function(e, i) {
                        n.showModal({
                            title: "删除照片",
                            content: "确定要删除这张照片么？",
                            cancelText: "取消",
                            confirmText: "删除",
                            success: function(t) {
                                t.confirm && e.splice(i, 1);
                            }
                        });
                    },
                    delVideo: function() {
                        var e = this;
                        n.showModal({
                            title: "提示",
                            content: "确定要删除视频么？",
                            cancelText: "取消",
                            confirmText: "删除",
                            success: function(t) {
                                t.confirm && (e.house.video = "");
                            }
                        });
                    },
                    onChooseVideo: function() {
                        var e = this;
                        e.$tools.chooseVideo().then(function(t) {
                            e.$tools.uploadFile("file.upload2", t).then(function(t) {
                                e.house.video = t.url;
                            });
                        });
                    },
                    attributeConfirm: function(t) {
                        console.info(t), this.house.decorate = t.decorate, this.house.direction = t.direction, 
                        this.house.type = t.type, this.house.attribute_index = t.index, this.house.attribute_names = t.names;
                    },
                    stwConfirm: function(t) {
                        console.info(t), this.house.shi = t.shi, this.house.ting = t.ting, this.house.wei = t.wei, 
                        this.house.stw_index = t.index, this.house.stw_names = t.names;
                    },
                    openHouseStw: function() {
                      console.log('执行openHouseStw');
                        this.$refs.houseStw.show(this.house.stw_index);
                        // this.$refs.house.show(this.house.stw_index);
                    },
                    openHouseAttribute: function() {
                      console.log('yes');
                        this.$refs.houseAttribute.show(this.house.attribute_index);
                    },
                    openCommunity: function() {
                        this.$Router.push({
                            path: "/pages/community/select",
                            query: {}
                        });
                    },
                    save: function() {
                        var t, e = this, i = this.house;
                        i.rent <= 0 ? e.$tools.toast("请填写租金") : i.name ? i.tel ? (t = "", 0 < this.wt_type_list.length && (t = this.wt_type_list[this.house.wt_type_index].id), 
                        t = {
                            id: i.id,
                            rent: i.rent,
                            name: i.name,
                            tel: i.tel,
                            ya_month: i.ya_month,
                            fu_month: i.fu_month,
                            let_way: i.let_way,
                            floor: i.floor,
                            floor_total: i.floor_total,
                            shi: i.shi,
                            wei: i.wei,
                            ting: i.ting,
                            dong: i.dong,
                            tit: i.tit,
                            dy: i.dy,
                            doorplate: i.doorplate,
                            mian_ji: i.mian_ji,
                            community_id: this.pubCommunity.id,
                            xiao_qu: this.pubCommunity.name,
                            house_type: i.type,
                            decorate: i.decorate,
                            direction: i.direction,
                            tag_ids: i.tag_ids,
                            tag_names: i.tag_names,
                            furnish_ids: i.furnish_ids,
                            guarantee: i.guarantee,
                            content: i.content,
                            cover: i.cover.join(","),
                            fj_imgs: i.fj_imgs.join(","),
                            kt_imgs: i.kt_imgs.join(","),
                            wsj_imgs: i.wsj_imgs.join(","),
                            cf_imgs: i.cf_imgs.join(","),
                            hx_imgs: i.hx_imgs.join(","),
                            xq_imgs: i.xq_imgs.join(","),
                            name2: i.name2,
                            // tel2: i.tel2,
                            room_type: i.room_type,
                            remark: i.remark,
                            wt_type: t
                        }, n.showLoading({
                            mask: !0,
                            title: "正在提交"
                        }), e.$api("lethouse.save", t, "post").then(function(t) {
                            0 == t.errno ? (n.hideLoading(), 0 == t.data.code ? (e.$tools.toast(t.data.msg), 
                            setTimeout(function() {
                                e.$Router.replace({
                                    path: "/pages/work/house/list"
                                });
                            }, 800)) : t.data.code) : e.$tools.toast("发布异常");
                        })) : e.$tools.toast("请填写联系电话") : e.$tools.toast("请填写联系人");
                    },
                    formSubmit: function(t) {
                        var e, i = this, o = this.house;
                        o.rent <= 0 ? i.$tools.toast("请填写租金") : o.name ? o.tel ? (e = "", 0 < this.wt_type_list.length && (e = this.wt_type_list[this.house.wt_type_index].id), 
                        o = {
                            id: o.id,
                            rent: o.rent,
                            name: o.name,
                            tel: o.tel,
                            ya_month: o.ya_month,
                            fu_month: o.fu_month,
                            let_way: o.let_way,
                            floor: o.floor,
                            floor_total: o.floor_total,
                            shi: o.shi,
                            wei: o.wei,
                            ting: o.ting,
                            dong: o.dong,
                            tit: o.tit,
                            dy: o.dy,
                            doorplate: o.doorplate,
                            mian_ji: o.mian_ji,
                            community_id: this.pubCommunity.id,
                            xiao_qu: this.pubCommunity.name,
                            house_type: o.type,
                            decorate: o.decorate,
                            direction: o.direction,
                            tag_ids: o.tag_ids,
                            tag_names: o.tag_names,
                            furnish_ids: o.furnish_ids,
                            guarantee: o.guarantee,
                            content: o.content,
                            cover: o.cover.join(","),
                            fj_imgs: o.fj_imgs.join(","),
                            kt_imgs: o.kt_imgs.join(","),
                            wsj_imgs: o.wsj_imgs.join(","),
                            cf_imgs: o.cf_imgs.join(","),
                            hx_imgs: o.hx_imgs.join(","),
                            xq_imgs: o.xq_imgs.join(","),
                            video: o.video,
                            name2: o.name2,
                            // tel2: o.tel2,
                            remark: o.remark,
                            wt_type: e,
                            room_type: o.room_type
                        }, n.showLoading({
                            mask: !0,
                            title: "正在提交"
                        }), i.$api("lethouse.pub", o, "post").then(function(t) {
                          console.log('t开始',t);
                          var is_ok=0;
                          if(t.data.code==0){
                              is_ok=1;
                              console.log('o.id的值',o.id);
                              if(!o.id){
                                    //温馨提示处理
                                    wx.showModal({
                                      title: '温馨提示',
                                      content: '帖子已发布，等待平台审核，请确保房源真实。平台合作或需要批量发布房源，可联系平台微信：leo00995',
                                      success: function (res) {
                                          if (res.confirm) {
                                              console.log('用户点击确定')
                                              wx.showToast({
                                                  title: '成功',
                                                  duration: 1000,
                                                  success: function () {
                                                  setTimeout(function () {
                                                  wx.reLaunch({
                                                  url: "/pages/work/house/list?is_all=0",
                                                    })
                                                  }, 1000);
                                              }
                                            })
                                                                                      
                                          }
                                          else{
                                            console.log('用户点击取消')
                                          }
                          
                                      }
                                  })
                              }else{
                                wx.showToast({
                                      title: '修改成功',
                                      duration: 1000,
                                      success: function () {
                                      setTimeout(function () {
                                      wx.reLaunch({
                                      url: "/pages/work/house/list?is_all=0",
                                        })
                                      }, 1000);
                                  }
                                })
                              }
                          }
                          console.log('is_ok的开始值',is_ok);
                          // 0 == t.errno
                            0 == t.data.code ? (n.hideLoading(), 0 == t.data.code ? (i.$tools.toast(t.data.msg), 
                            setTimeout(function() {
                                // i.$Router.push({
                                //     path: "/pages/work/house/list"
                                // });
                            }, 800)) : t.data.code) : !o.id?i.$tools.toast(t.data.msg):i.$tools.toast('修改成功!');
                        })) : i.$tools.toast("请填写联系电话") : i.$tools.toast("请填写联系人");
                        // console.log('is_ok',is_ok);
                        
                        







                    }
                }
            };
            o.default = e;
        }).call(this, s("543d").default);
    },
    a7d7: function(t, e, i) {
        i.d(e, "b", function() {
            return n;
        }), i.d(e, "c", function() {
            return s;
        }), i.d(e, "a", function() {
            return o;
        });
        var o = {
            wkLoginModal: function() {
                return i.e("components/wk-login-modal/index").then(i.bind(null, "978a"));
            },
            wkMultiSelect: function() {
                return i.e("components/wk-multi-select/index").then(i.bind(null, "d8a9"));
            }
        }, n = function() {
            this.$createElement;
            this._self._c;
        }, s = [];
    },
    b309: function(t, e, i) {
        i.r(e);
        var o, n = i("017d"), s = i("040c");
        for (o in s) "default" !== o && function(t) {
            i.d(e, t, function() {
                return s[t];
            });
        }(o);
        i("68c0");
        var a = i("f0c5"), n = Object(a.a)(s.default, n.b, n.c, !1, null, null, null, !1, n.a, void 0);
        e.default = n.exports;
    },
    bd13: function(t, e, o) {
        (function(t) {
            o("767a"), i(o("66fd"));
            var e = i(o("4568"));
            function i(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = o, t(e.default);
        }).call(this, o("543d").createPage);
    },
    c7e1: function(t, e, i) {}
}, [ [ "bd13", "common/runtime", "common/vendor" ] ] ]);